package 软件开发原则.里氏替换原则.after;

public class RectangleDemo {
    public static void main(String[] args) {
        //创建长方形对象
        Rectangle r=new Rectangle();
        r.setLength(20);
        r.setWidth(10);
        resize(r);
        printLengthWidth(r);
    }
    public static void resize(Rectangle rectangle){
        //判断如果宽比长小，进行扩展的操作
        while(rectangle.getWidth()<= rectangle.getLength()){
            rectangle.setWidth(rectangle.getWidth()+1);
        }
    }
    public static  void printLengthWidth(Quadrilateral quadrilateral){
        System.out.println(quadrilateral.getLength());
        System.out.println(quadrilateral.getWidth());
    }
}
